<?php 
require("../connection.php");

$navn = $_GET['navn'];
$value= $_GET['value'];
$id   = $_GET['uid'];

switch($navn)
{
	case "usrt":
	$tabell = "usertype";
	break;
	
	case "fname":
	$tabell = "firstname";
	break;
	
	case "sname":
	$tabell = "surname";
	break;
	
	case "mail":
	$tabell = "email";
	break;
	
	case "tele":
	$tabell = "telephone";
	break;
	
	case "web":
	$tabell = "website";
	break;
	
	default:
	echo "No, motherfucker!";
}

	$sql = "UPDATE user SET $tabell = :value WHERE id = :id";
	$sth = $db->prepare($sql);
	$sth->bindParam(":id",$id);
	$sth->bindParam(":value",$value);
	$sth->execute();
	echo "Dritten blei endra ditt rasshøl!";

?>